#----------------------------
# Name: Chris Spooner
# Project: Madlibs.py
# Period: 2
# Start Date: 9/17/2013
# Last Revision Date: 9/17/2013
# Version: 1.0.0
#----------------------------

swearFilter = ["dumb",
               "stupid",
               "retard"
               "Jack sunglasses emoji Shock poop swastika",
               "cunt",
               "muff",
               "vajay",
               "vagina",
               "penis" ,
               "dick" ,
               "cock" ,
               "pussy" ,
               "puss" ,
               "poon" ,
               "shlong", 
               "bepis" ,
               "nigger" ,
               "nigga" ,
               "bitch" ,
               "swastika",
               "poop" ,
               "scat" ,
               "niga" ,
               "niger" ,
               "fetus" ,
               "fuck" ,
               "shit" ,
               "balls" ,
               "hitler" ,
               "shitler" ,
               "piss" ,
               "jizz" ,
               "anal",
               "butt stuff",
               "ass",
               "dong",
               "masturbate",
               "masturbation",
               "asshole",
               "damn",
               "god dammit",
               "god damn it",
               "dammit",
               "micropenis",
               "fuckton",
               "bad touch",
               "pedophile",
               "vag",
               "whore",
               "slut",
               "weed",
               "drugs",
               "crack",
               "coke",
               "meth",
               "crank",              
               "speed",
               "molly",
               "x",
               "ecstasy",
               "shrooms",
               "nazi",
               "BBW",
               "tranny",
               "shemale",
               "ladyboy",
               "bondage",
               "smut",
               "fetish",
               "tits",
               "boobs",
               "jugs",
               "butthole",              
               "squirt",
               "marijuana",
               "dro",
               "bong",
               "joint",
               "blunt",
               "bowl",
               "pipe",
               "vaporizer",
               "vape",
               "porn star",
               "dummy",
               "idiot",
               "fart",
               "drunk",
               "alcohol",
               "wasted",
               "fucked up", 
               "heroin",
               "cigarette",
               "cigs",
               "lighter",
               "buzzed",
               "buzz",
               "high",
               "ganja",
               "dabs",
               "motherfucker",
               "milf",
               "dildo",
               "vibrator",
               "pocket pussy",
               "fleshlight",
               "faggot",
               "fag",
               "rectum",
               "asslime"
               "ass slime"
               "douche",
               "kedamine",
               "peen",
               "spic",
               "ding dong",
               "ching chong",
               "bing bong",
               "king kong",
               "turnt up",
               "turn up",
               "porch monkey",
               "gook",
               "chink",
               "slope",
               "rape",
               "rapist",
               "fetal",
               "ejaculate"
               "douchebag"
               "condom"
               "breasticles"
               "footjob"
               "bang"
               "dry hump"
               "prejaculate"
               "bad words"
               "doggystyle"
               "fucking"
               "shitting" 
               "humping"
               "shitted"
               "shited"
               "humped"
               "hump"
               "chris"
               "jesus"
               "christ"
               "jesus christ"
               "potato"
               ]
               
            

def displayStartScreen():
    print "Madlibs"
    raw_input("Press Enter to Continue")
    
def displayEndScreen():
    print "Goodbye"
    raw_input("Press Enter to Exit")

def getMenuOption(maxOption):
    option = ""
    goodOption = False
    while not goodOption:
        option = raw_input("Enter Number or Q> ")
        option = option.upper()
        for num in range(1, maxOption+2):
            if option == str(num):
                goodOption = True
        if option == 'Q':
            goodOption = True
        if not goodOption:
            print "Please pick a valid option!"
    return option
        
def menu(options):
    print "------Please Select a Story------"
    print " [1] The Dragon"
    print " [2] The Fresh Prince"
    print " [3] Conor went too hard"
    print " [Q] Quit"
    print "----------------------------------"
    option = getMenuOption(options)
    return option
    
def getWord(prompt):
    word = ""
    goodWord = False
    while not goodWord:
        word = raw_input(prompt)
        if word.lower() not in swearFilter:
            goodWord = True
        else:
            print "Naughty player ;) ...please be polite."
        if not goodWord:
            print "Try again"
    return word
    
def getNumber(prompt, max = "", min = ""):
    num = ""
    goodNum = False
    while not goodNum:
        isNum = True
        num = raw_input(prompt)
        for character in num:
            if character not in "0123456789":
                isNum = False
        if min != "":
            if isNum:
                if float(num) < min:
                    isNum = False
        if max != "":
            if isNum:
                if float(num) > max:
                    isNum = False
        if isNum:
            goodNum = True
        else:
            print "Not a valid number, try again."
    return num
        
def story1():
    adjective = getWord("Enter a place: ")
    bodyParts = getWord("Enter a body part (plural): ")
    noun = getWord("Enter a noun: ")
    bodyPart = getWord("Enter a body part: ")
    story = "The "
    story += adjective + " "
    story += "dragon is a very "
    story += adjective + " "
    story += "creature. It has "
    story += adjective + " "
    story += bodyParts + ", "
    story += "and a "
    story += bodyPart 
    story += "shaped like a "
    story += noun + ". "
    story += "It loves to eat "
    story += pluralAnimal + ", " 
    story += "although it will feast on nearly anything. It is "
    story += adjective + " and " + adjective + ". You must be "
    story += adjective + " around it, or you may end up as it's meal!"
    print story
    
def story2():
    name = getWord("Enter a name: ")
    age = getNumber("Enter a number: ")
    place1 = getWord("Enter a place: ")
    place2 = getWord("Enter a place: ")
    place3 = getWord("Enter a place: ")
    place4 = getWord("Enter a place: ")
    noun1 = getWord("Enter a noun: ")
    noun2 = getWord("Enter a noun: ")
    noun3 = getWord("Enter a noun: ")
    noun4 = getWord("Enter a noun: ")
    noun5 = getWord("Enter a noun: ")
    noun6 = getWord("Enter a noun: ")
    noun7 = getWord("Enter a noun: ")
    noun8 = getWord("Enter a noun: ")
    noun9 = getWord("Enter a noun: ")
    pluralNoun = getWord("Enter a plural noun: ")
    adjective1 = getWord("Enter an adjective: ")
    adjective2 = getWord("Enter an adjective: ")
    adjective3 = getWord("Enter an adjective: ")
    verb1 = getWord("Enter a verb: ")
    verb2 = getWord("Enter a verb: ")
    verb3 = getWord("Enter a verb: ")
    verb4 = getWord("Enter a verb: ")
    story = "In West " + place1 + " born and raised. "
    story += " On the " + place2 + " is where I spent most of my days."
    story += adjective1 + "in out, maxin, relaxin all cool "
    story += "and shootin some " + noun1 + " outside of the " + place3 + " "
    story += "when a couple of " + pluralNoun + " that were up to no good started making trouble in my "
    story += place4 + ". I got in one fight and my " + noun2 + " got scared. She said you're moving with your " + noun3 + " and" + noun4 + " in" + place3 + "."
    story += " I " + verb1 + "ed for a " + noun5 + " and when it came near the " + noun6 + " said " + adjective2 + " and it had"  
    story += pluralNoun + " in the " + noun + ". "
    story += "If anything I could say that this " + noun7 + " was " + adjective3 + " but I thought nah forget it, Yo home, to " + place3 + ". "
    story += "I " + verb2 + "ed to the house around 7 or 8 and I " + verb3 + "ed to the " + noun8 + " Yo holmes, " + verb4 + " you later. "
    story += "Looked at my kingdom, I was finally there, to sit on my " + noun9 + ", as the prince of " + place3 + "."
    print story

def story3():
    adjective1 = getWord("Enter an adjective: ")
    adjective2 = getWord("Enter an adjective: ")
    noun1 = getWord("Enter a noun: ")
    place = getWord("Enter a place: ")
    number = getword("Enter a number: ")
    pluralNoun = getWord("Enter a plural noun: ")
    adjective3 = getWord("Enter an adjective: ")
    animal = getWord("Enter an animal: ")
    story += "One night, while Conor was home alone on the computer, his " + adjective1 + "friend called him and asked to hang out. "
    story += "Conor decided to go out, he thought it would be " + adjective2 + ". "
    story += "He grabbed his " + noun1 + "and walked out the door. That was the last thing he remembered."
    story += "When he awoke, he was in a hotel room in " + place + ". "
    story += "He turned around, and saw " + number + pluralNoun + " laying on the floor. "
    story += "Before he knew it, he heard a " + adjective3 + "roar, almost like a " + animal + "'s. "
    story += "Conor decided to investigate the noise. It WAS a " + animal + "! "
    story += "The animal ate Conor and went back to sleep. Conor went too hard."
    print story
    
def run():
    displayStartScreen()
    choice = ""
    while choice != 'Q':
        choice = menu(2)
        if choice == '1':
            story1()
        elif choice == '2':
            story2()
        elif choice == '3':
            story3()
        elif choice == 'Q':
            displayEndScreen()
        else:
            print "Something Awful Ocurred...yell at programmer!"
    exit()
run()